package com.wc.tt;

public enum LeaveType {
    leave1(1, "事假", 4, 2),
    leave2(2, "病假", 2, 1);

    //请假类型标志
    int type;
    //请假名称
    String desc;
    //基本分数
    double baseScore;
    //绩效分数
    double performanceScore;

    LeaveType(int type, String desc, double baseScore, double performanceScore) {
        this.type = type;
        this.desc = desc;
        this.baseScore = baseScore;
        this.performanceScore = performanceScore;
    }

    public static double getBaseScore(double type) {
        for (LeaveType t : values()) {
            if (type == t.type) {
                return t.baseScore;
            }
        }
        return 0;
    }

    public static double getPerformanceScore(double type) {
        for (LeaveType t : values()) {
            if (type == t.type) {
                return t.performanceScore;
            }
        }
        return 0;
    }

    public int type() {
        return type;
    }
}

